<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02_css选择器</title>
    <style>
        #d1 {
            color: red;
            background-color: yellow;
        }
        #d1:hover{
            color: yellow;
            background-color: red;
        }
        .msg {
            color: aliceblue;
        }
        .error {
            background-color: red;
        }
        .success {
            background-color: green;
        }
        h4,#d1:hover,.error{
            border: 5px solid black;
        }
        a:link {
            color: gray;
        }
        a:visited {
            color: green;
        }
        a:hover {
            color: orange;
        }
        a:active {
            color: red;
        }
        input[name="uname"]{
            background-color: yellow;
        }
        * {
            font-style: italic;
        }
        #d2 span {
            background-color: pink;
        }
        div>div>p>span {
            color: red;
        }
    </style>
</head>
<body>
<div id="d1"> 我是div</div>
<div>我是div</div>
<p>这是段落</p>
<h4>这是标题</h4>
<h4>这是标题</h4>
<hr>
<span class="error msg">这是span</span>
<span class="error msg">这是span</span>
<span class="success msg">这是span</span>
<span class="success msg" >这是span</span>
<br>
<a href="https://www.baidu.com" target="_blank">超链接</a>
<br>
<a href="css1.css" target="_blank">超链接</a>
<br>
<a href="aaa" target="_blank">超链接</a>
<hr>
<input type="text" name="uname">
<br>
<input type="text" name="nickname">
<br>
<select name="uname" id="">
    <option value="xiaobei">北</option>
    <option value="xiaofang">方</option>
</select>
<div id="d2">
    <span>111</span>
    <div>
        <span>222</span>
        <p>测试文字</p>
        <p>我是<span>333</span>段落</p>
        <span>444</span>
    </div>
</div>

</body>
</html>